package com.memer;

public class Eight {
    @app.route('/second_page')
    def index():
    data = query()
    #  名字
    name =[]
            #  数量
    num = []
            for row in data:
            #  名字
       name.append( row[0] )
            #  数量
       num.append( row[1])
    print("名字:"+str(name) + "数量:"+str( num ))

            # 饼状图
            pie = (
            Pie()
                    .add("", [ list(z) for z in zip( name, num  ) ])
            .set_global_opts(title_opts=opts.TitleOpts(title="Pie Chart"))
            )
            return render_template('second_page.html', pie=pie.render_embed())
}
